package com.taokatao.cardmee.api;

import com.taokatao.cardmee.api.model.CardDetailInfo;
import com.taokatao.cardmee.api.model.CardFDInfo;
import com.taokatao.cardmee.api.model.CardFDMyCourseInfo;
import com.taokatao.cardmee.api.model.CardFDSignInfo;
import com.taokatao.cardmee.api.model.CardShareInfo;
import com.taokatao.cardmee.api.model.CardTypeInfo;
import com.taokatao.cardmee.api.model.SecretCardInfo;
import com.taokatao.cardmee.api.model.UploadCardIconInfo;
import com.taokatao.cardmee.api.model.UploadCardPictureInfo;
import com.taokatao.cardmee.api.model.UploadPhotoInfo;
import com.taokatao.cardmee.db.model.Card;
import com.taokatao.cardmee.db.model.CardStore;
import com.taokatao.cardmee.db.model.Message;
import com.taokatao.cardmee.db.model.User;

import java.util.List;

import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.POST;
import rx.Observable;

/**
 * 卡蜜后台接口API
 */
@SuppressWarnings("unused")
interface ApiService {

    /**
     * 1、获取所有商家类型(商家分类，如餐饮、购物、娱乐休闲等)
     */
    @POST("wapServer/member/getAllMcardCategory.do")
    Observable<RespWrapper<List<CardTypeInfo>>> queryCardType(@Body RequestBody req);

    /**
     * 2、获取会员卡列表
     */
    @POST("wapServer/member/getMemberCards.do")
    Observable<RespWrapper<List<Card>>> queryMyCard(@Body RequestBody req);

    /**
     * 3、获取所有商家信息
     */
    @POST("wapServer/business/getAllBusinessInfo.do")
    Observable<RespWrapper<List<CardStore>>> queryCardStore(@Body RequestBody req);

    /**
     * 5、添加会员卡
     */
    @POST("wapServer/member/addMemberCard.do")
    Observable<RespWrapper<Card>> addCard(@Body RequestBody req);

    /**
     * 6、更新我的会员卡信息
     */
    @POST("wapServer/member/updateMemberCard.do")
    Observable<RespWrapper<RespInfo>> updateCard(@Body RequestBody req);

    /**
     * 7、删除我的会员卡
     */
    @POST("wapServer/member/removeMemberCard.do")
    Observable<RespWrapper<RespInfo>> deleteCard(@Body RequestBody req);

    /**
     * 8、获取会员卡分享链接
     */
    @POST("wapServer/share/getShareMCardUrl.do")
    Observable<RespWrapper<CardShareInfo>> obtainCardShareUrl(@Body RequestBody req);

    /**
     * 9、取消收藏会员卡
     */
    @POST("wapServer/share/collectMcardCancel.do")
    Observable<RespWrapper<RespInfo>> cancelStarCard(@Body RequestBody req);

    /**
     * 10、个人中心-手机设备号静默注册
     */
    @POST("wapServer/userInfo/silenceRegister.do")
    Observable<RespWrapper<User>> register(@Body RequestBody req);

    /**
     * 11、个人中心-获取手机验证码
     */
    @POST("wapServer/userInfo/createRandomCode.do")
    Observable<RespWrapper<RespInfo>> obtainAuthCode(@Body RequestBody req);

    /**
     * 12、个人中心-绑定手机or登录
     */
    @POST("wapServer/userInfo/bindTel.do")
    Observable<RespWrapper<User>> login(@Body RequestBody req);

    /**
     * 13、个人中心-编辑个人资料
     */
    @POST("wapServer/userInfo/updateUserInfo.do")
    Observable<RespWrapper<RespInfo>> updateUser(@Body RequestBody req);

    /**
     * 15、会员卡图片上传接口
     */
    @POST("wapServer/upload/uploadMcardIcon.do")
    Observable<RespWrapper<UploadCardPictureInfo>> uploadCardPicture(@Body RequestBody req);

    /**
     * 16、用户头像上传接口
     */
    @POST("wapServer/upload/uploadHeadIcon.do")
    Observable<RespWrapper<UploadPhotoInfo>> uploadAvatar(@Body RequestBody req);

    /**
     * 16、其他商家图片上传接口
     */
    @POST("wapServer/upload/uploadOtherBusIcon.do")
    Observable<RespWrapper<UploadCardIconInfo>> uploadCardIcon(@Body RequestBody req);

    /**
     * 21、会员卡使用次数
     */
    @POST("wapServer/member/updateMCardUseCount.do")
    Observable<RespWrapper<RespInfo>> updateCardUseCount(@Body RequestBody req);

    /**
     * 22、获取会员卡详细信息
     */
    @POST("wapServer/member/getMcardDetails.do")
    Observable<RespWrapper<CardDetailInfo>> obtainCardDetail(@Body RequestBody req);


    /**
     * 25、扫码添加商家版会员卡
     */
    @POST("wapServer/bussiness/scanToAddCard.do")
    Observable<RespWrapper<Card>> scanToAddMemberCard(@Body RequestBody req);

    /**
     * 26、扫码领取会员卡--确认
     */
    @POST("wapServer/bussiness/scanToAddCardConfirm.do")
    Observable<RespWrapper<RespInfo>> scanToAddCardConfirm(@Body RequestBody req);

    /**
     * 27、秘钥领取会员卡
     */
    @POST("wapServer/bussiness/secretToAddCard.do")
    Observable<RespWrapper<SecretCardInfo>> secretToAddCard(@Body RequestBody req);


    /**
     * 28、秘钥领取会员卡--确认
     */
    @POST("wapServer/bussiness/secretToAddCardConfirm.do")
    Observable<RespWrapper<RespInfo>> secretToAddCardConfirm(@Body RequestBody req);

    /**
     * 29、获取我的商家消息列表
     */
    @POST("wapServer/bussiness/getMyMessageList.do")
    Observable<RespWrapper<List<Message>>> getMyMessageList(@Body RequestBody req);

    /**
     * 30、获取商品套餐详情
     */
    @POST("wapServer/bussiness/getMcardProductDetails.do")
    Observable<RespWrapper<CardFDInfo>> getMcardProductDetails(@Body RequestBody req);


    /**
     * 32、获取商家课程列表
     */
    @POST("wapServer/bussiness/getBranchCourseList.do")
    Observable<RespWrapper<List<CardFDMyCourseInfo>>> getBranchCourseList(@Body RequestBody req);


    /**
     * 33、用户预约商家课程
     */
    @POST("wapServer/bussiness/orderBranchCourse.do")
    Observable<RespWrapper<RespInfo>> orderBranchCourse(@Body RequestBody req);

    /**
     * 34、用户签到获得列表(主动扫码)
     */
    @Deprecated
    @POST("wapServer/bussiness/userActiveSign.do")
    Observable<RespWrapper<List<CardFDMyCourseInfo>>> userActiveSign(@Body RequestBody req);

    /**
     * 35、用户扫码签到-确认
     */
    @POST("wapServer/bussiness/userActiveSignConfirm.do")
    Observable<RespWrapper<CardFDSignInfo>> userActiveSignConfirm(@Body RequestBody req);


    /**
     * 24、被扫二维码格式
     *
     * 二维码格式：<br>
     * http://wap.taokatao.cn:64559/wapServer/bussiness/downAddSign.do?storeId=1(测试)  <br>
     *  http://c.flow360.cn:4559/wapServer/bussiness/downAddSign.do?storeId=1(正式)<br>
     *  如果匹配到和上面链接下划线部分一致的url就发出下面的请求<br>
     *  请求地址：<br>
     *  http://域名:端口/wapServer/bussiness/addSign.do<br>
     */
    @POST("wapServer/bussiness/addSign.do")
    Observable<RespWrapper<String>> addSign(@Body RequestBody req);

}
